const { createProxyMiddleware } = require("http-proxy-middleware");

module.exports = function (app) {
  app.use(
    "/api",
    createProxyMiddleware({
      //需要改成后端的ip,如果部署在同一台服务器为 http://127.0.0.1:8000/
      target: "http://202.207.12.170:8000/",
      changeOrigin: true,
      pathRewrite: {
        '^/api': '',
    }
    })
  );
  
};
